
<p-growl [(value)]="msgs"></p-growl>

<div class="container blog-content-container">
  <div class="row" *ngIf="userService.currentUser==null">
    <p>未获取到用户信息,请登录之后在来此页操作</p>
  </div>

  <div class="row" *ngIf="userService.currentUser!=null">

    <!-- 左侧栏目 -->
    <div class="col-md-4 col-xl-3">
      <div class="row">
        <div class="col-md-12">
           <span>
             <a class="blog-edit-avatar">
								<img [src]="userService.currentUser?.avatar == null ? 'assets/images/avatar-default.jpg' : userService.currentUser?.avatar" class="blog-avatar blog-avatar-230">
							</a>
           </span>
        </div>
      </div>
    </div>

    <div class="col-md-8 col-xl-9">
      <!-- 个人设置 -->
      <div class="panel panel-default">
        <div class="panel-heading">
          <h5 class="card-header"><i class="fa fa-cog" aria-hidden="true"></i>个人设置</h5>
        </div>
        <div class="panel-body">
          <form  method="post"  id="userForm">
            <div class="form-group ">
              <label for="username" class="col-form-label">账号</label>
              <input type="text" class="form-control" id="username" name="username" [(ngModel)]="userService.currentUser.username" readonly="readonly">
            </div>
            <div class="form-group">
              <label for="email" class="col-form-label">邮箱</label>
              <input type="email" class="form-control" id="email" name="email" [(ngModel)]="userService.currentUser.email" maxlength="50" placeholder="请输入邮箱">
            </div>
            <div class="form-group">
              <label for="name" class="col-form-label">昵称</label>
              <input type="text" class="form-control" id="name" name="name" [(ngModel)]="userService.currentUser.nickname" maxlength="20"
                     placeholder="请输入姓名，至少2个字符，至多20个">
            </div>
            <div class="form-group">
              <label for="password" class="col-form-label">密码</label>
              <input type="password" class="form-control" id="password" name="password" [(ngModel)]="userService.currentUser.password" maxlength="30" placeholder="请输入密码，至少3个字符，至多30个">
            </div>
            <div class="form-group">
              <button type="submit" class="btn btn-primary" (click)="onSubmit();">保存</button>
            </div>
          </form>
        </div>
      </div>
    </div>


  </div>


</div>
